<?php
    $db = new Database();
    $user = explode("/",$_SERVER["REQUEST_URI"]);
    $search_user = explode("_",$user[2]);
    $lname = str_replace("%20"," ",$search_user[0]);
    $fname = str_replace("%20"," ",$search_user[1]);
    $u = $db->query("SELECT * FROM tbuser WHERE last_name={$db->escape($lname)} AND first_name={$db->escape($fname)} AND is_active={$db->escape(1)}","row");
    $personDoc = new Person($db,$u['id']);
    $userCompany = new userQueries();
 ?>
   <Br/>
  <div class="fl-option-toolbar">
    <div class="fl-toolbar-left-wrapper">
      <h1><?php
                  echo $personDoc->first_name . " " . $personDoc->last_name . "'s profile";
               ?></h1>
    </div>
    <div class="fl-toolbar-right-wrapper">
        <!-- <a class="pinit icon dataTip" data-placement="left" data-original-title="Pin this to Dashboard"></a> -->
    </div>
     <div class="clearfix"></div>
  </div><!-- end of option toolbar -->
  <div class="fl-profile-wrapper">
    <div class="two-columns col" style="width:250px;">
      <div class="large-avatar-wrapper"><?php echo $userCompany->avatarPic("companyUser",$personDoc->id,"230","230","large"," userPhoto personalPhoto"); ?></div>
    </div>
    <div class="two-columns col">
      <?php
      if($personDoc->display_name!=""){
      ?>
        <h2><span class="theme-font-color">Display Name</span>: <?php echo $personDoc->display_name; ?></h2>
      <?php
      }
      if($personDoc->position!=""){
      ?>
        <h2><span class="theme-font-color">Position</span>: <?php echo $personDoc->position; ?></h2>
      <?php
      }
      if($personDoc->department->name!=""){
      ?>
        <h2><span class="theme-font-color">Department</span>: <?php echo $personDoc->department->name; ?></h2>
      <?php
      }
      if($personDoc->contact_number!=""){
      ?>
        <h2><span class="theme-font-color">Contact Number</span>: <?php echo $personDoc->contact_number; ?></h2>
      <?php
      }
      if($personDoc->date_registered!=""){
      ?>
       <h2><span class="theme-font-color">Date Registered</span>: <?php echo $personDoc->date_registered; ?></h2>
      <?php
      }
      ?>
    </div>
    <div class="clearfix"></div>
  </div>
  
